include([
 'renderers.Renderer'], 

function(){

	declare('renderers.StandardRenderer');
	
	StandardRenderer = Renderer.extend({
		init : function(name){
			this._super(name || 'StandardRenderer' + (Renderer.count++));
		},
		renderObject : function(gw, obj){
			if( obj.render ){
				var pass = false;
				try{
					gw.c.save();
					obj.render(gw);
					pass = true;
				}finally{
					if(!pass){
						console.log("Removing entity. Failed to render.");
						console.debug(obj);
					}
					gw.c.restore();				
				}
			}else{
				console.log("Removing entity. Has no render method.")
				console.debug(obj);
			}
			return pass;
		}
	});
	Renderer.standard = new StandardRenderer();
});